<template>
	<view>
		<!-- <view class="recharge_way card_box">
		</view> -->
		<view class="recharge_box card_box">
			<view class="recharge_way_list">
				<view class="recharge_way_item">
					<view class="menu_item">
						<view class="avatoa">
							<image :src="transferUserInfo.friendHeader" class="imgava"></image>
							<view class="">
								<view class="">
									<text class="menu_title">{{transferUserInfo.friendName}}</text>
								</view>
								<view class="">
									<text class="bank_card_no">{{account(transferUserInfo.Account)}}</text>
								</view>
							</view>
						</view>
					</view>
				</view>
			</view>
			<view class="recharge_hint">
				转账账户
			</view>
			<view class="recharge_input">
				<input class="input sm" placeholder="云智汇账户/手机号" type="number" value="" v-model="transferAccount" /><text class="input_btn">联系人</text>
			</view>
			<view class="recharge_hint">
				备注
			</view>
			<view class="recharge_input">
				<input class="input sm" placeholder="添加备注(50字内)" type="number" value="" v-model="transferNote" />
			</view>
		</view>
		<view class="recharge_box card_box">
			<view class="recharge_hint">
				转账金额
			</view>
			<view class="recharge_input">
				￥<input class="input" type="number" value="" v-model="amount" />
			</view>
		</view>
		<view class="hint">
			<text>温馨提示：钱款将实时转入对方账户，无法退款，请认真核实</text>
		</view>
		<view class="submit">
			<view class="submitBtn" @click="transferBtn">确认转账</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				amount: '',
				transferAccount: '14797758258',
				transferNote: '',
				transferUserInfo: {
					friendName: '张三',
					friendHeader: '../../../static/images/ren.png',
					Account: '14797758258',
				}
			};
		},
		methods: {
			transferBtn() {
				uni.request({
					method: 'POST',
					url: 'https://qiancheng.mynatapp.cc/common/biz/cloud/order/appTransfer',
					data: {
						sourceAccountSetNo: '100001',
						targetBizUserId: 'f6b18eff1968411c8bd130f0789da911',
						targetAccountSetNo: '400193',
						amount: 11,
						extendInfo: '测试转账'
					},
					header: { 'content-type': 'application/json' },
					success: (res) => {
						console.log(res)
						if(res.code == 10000) {
							// 转账成功
						} else {
							// 转账失败
						}
					},
					fail: (err) => {
						uni.hideLoading()
						console.log(err)
					}
				})
			}
		},
		computed: {
			account(account) {
				return function(account) {
					return account.replace(/(\d{3})\d{4}(\d{4})/, "$1****$2")
				}
			}
		}
		
	}
</script>
<style>
	page {
		background-color: #f8f8f8;
	}
</style>
<style lang="scss">
	.card_box {
		box-shadow: 0px 2px 8px 0px #ededed;
		margin-bottom: 20rpx;
		background-color: #FFF;
	}

	.recharge_hint {
		font-size: 34rpx;
		padding: 36rpx 36rpx 0;
	}

	.recharge_input {
		display: flex;
		flex-direction: row;
		justify-content: flex-start;
		align-items: center;
		font-size: 60rpx;
		padding: 36rpx;

		.input {
			width: 100%;
			height: 90rpx;
			line-height: 90rpx;
			padding: 24rpx;
			font-size: 80rpx;
			&.sm{
				height: 40rpx;
				line-height: 40rpx;
				font-size: 30rpx;
				padding: 0 24rpx;
			}
		}
		
		.input_btn{
			display: inline-block;
			width: 120rpx;
			color: #0A98D5;
			font-size: 30rpx;
		}
	}

	.recharge_way_list {
		margin-top: 24rpx;
	}

	.menu_item {
		display: flex;
		flex-direction: row;
		justify-content: space-between;
		align-items: center;
		padding: 24rpx;
		background-color: #FFFFFF;

		.radio {
			width: 100%;
			display: flex;
			flex-direction: row;
			justify-content: space-between;
			align-items: center;
		}

		&:active {
			background-color: #f6f6f6;
		}
	}


	.avatoa {
		display: flex;
		align-items: center;
	}

	.imgava {
		width: 56rpx;
		height: 56rpx;
		margin-right: 25rpx;
	}

	.menu_title {
		font-family: PingFangSC;
		font-weight: 400;
		font-size: 34rpx;
		color: #000000;
	}
	
	.bank_card_no {
		font-size: 28rpx;
		color: #999;
	}

	.arrow_icon {
		color: #333;
	}

	// 按钮组
	.submit {
		text-align: center;
		padding: 24upx;

		.submitBtn {
			border-width: 0px;
			height: 100upx;
			line-height: 100upx;
			background: inherit;
			background-color: $uni-color-primary;
			box-sizing: border-box;
			border-width: 0;
			border-radius: 6upx;
			-moz-box-shadow: none;
			-webkit-box-shadow: none;
			box-shadow: none;
			color: #FFFFFF;

			&.radius_btn {
				border-radius: 50upx;
				box-shadow: 0px 8px 9px 0px #c3defc;
			}

			&:active {
				background-color: #3266a5;
			}

			&::after {
				border: none;
			}
		}
	}
	
	.hint{
		font-size: 26rpx;
		color: #e74c3c;
		padding: 24rpx;
	}
</style>
